from email.policy import default

from django.db import models

# Create your models here.
class QueueList(models.Model):
    name = models.CharField(max_length=100, blank=True, null=True)
    code = models.IntegerField(default=0, unique=True)
    uuid = models.UUIDField()

    current = models.IntegerField(default=0)

    create_time = models.DateTimeField(auto_now_add=True)
    last_call_time = models.DateTimeField(blank=True, null=True)
    avg_waiting_time = models.IntegerField(default=0)

    bulletin = models.TextField()

    def __str__(self):
        return self.name

class QueueMember(models.Model):
    name = models.CharField(max_length=100)
    uuid = models.UUIDField()

    comment = models.TextField()

    queue_list = models.ForeignKey(QueueList, on_delete=models.CASCADE)
    create_time = models.DateTimeField(auto_now_add=True)